package cn.rcth.base.enums;

/**
 * @Author: yanghuanyu
 * @Date: 2019/5/27 10:46
 * @Version 1.0
 */

public enum WuliuCode {

    SF("顺丰", 1, "SFEXPRESS"),
    ZT("中通", 2, "ZTO"),
    ST("申通", 3, "STO"),
    YT("圆通", 4, "YTO"),
    HT("汇通", 5, "HTKY"),
    YD("韵达", 6, "YUNDA"),
    YZ("邮政包裹/平邮", 7, "CHINAPOST"),
    EMS("EMS", 8, "EMS"),
    TT("天天", 9, "TTKDEX"),
    DB("德邦", 10, "DEPPON");

    private String name;
    private int value;
    private String type;

    WuliuCode(String name, int value, String type) {
        this.name = name;
        this.value = value;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static String getType(int value){
        WuliuCode[] values = WuliuCode.values();
        for (WuliuCode wuliuCode : values) {
                if(wuliuCode.getValue() == value)
                    return wuliuCode.getType();
        }
        return null;
    }

}